import * as path from "path";
import * as vscode from "vscode";

export function activate(context: vscode.ExtensionContext) {
  console.log('Congratulations, your extension "vsc-show" is now active!');
  /*  vscode.languages.registerHoverProvider(
    "javascript",
    new (class implements vscode.HoverProvider {
      provideHover(
        document: vscode.TextDocument,
        _position: vscode.Position,
        _token: vscode.CancellationToken,
      ): vscode.ProviderResult<vscode.Hover> {
        const args = [{ resourceUri: document.uri }];
        const commentCommandUri = vscode.Uri.parse(
          `command:git.stage?${encodeURIComponent(JSON.stringify(args))}`,
        );
        const contents = new vscode.MarkdownString(
          `[Stage file](${commentCommandUri})`,
        );
        contents.isTrusted = true;
        return new vscode.Hover(contents);
      }
    })(),
  );*/

  // The command has been defined in the package.json file
  // Now provide the implementation of the command with registerCommand
  // The commandId parameter must match the command field in package.json
  let disposable = vscode.commands.registerCommand(
    "vsc-show.helloWorld",
    () => {
      vscode.window.showInformationMessage(
        "Hello World from vsc-show and masaikk!",
      );
    },
  );

  let disposable2 = vscode.commands.registerCommand("vsc-show.comment", () => {
    vscode.commands.executeCommand("editor.action.addCommentLine");
    // 上一行的以上是注释当前贯标所在行
  });

  context.subscriptions.push(disposable);
  context.subscriptions.push(disposable2);
}

// This method is called when your extension is deactivated
export function deactivate() {}
